import Vue from 'vue'
import VueRouter from 'vue-router'

 //引入需要跳转的组件页面
import TeacherMain from '../components/TeacherMain.vue'
import LoReg from '../components/LoginAndRegister'
import ImageDetection from '../components/ImageDetection.vue'
import VideoDetection from '../components/VideoDetection.vue'
import RulerLogin from '../components2/RulerLogin.vue'
import RulerMain from '../components2/RulerMain.vue'
import Assessment from '../components/Assessment.vue'
import ClassManage from '../components2/ClassManage.vue'

//调用 Vue.use()函数，把VueRouter 安装为Vue的插件
Vue.use(VueRouter);

//创建路由的实例对象
const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes:[
        {
            name:'TeacherMain',
            path:'/TeacherMain',
            component:TeacherMain,
            props:true,
            redirect: '/TeacherMain',  
            children:[
                {
                    path:'',
                    component:ImageDetection,
                },
                {
                    path:'VideoDetection',
                    component:VideoDetection,
                },
                {
                    path:'Assessment',
                    component:Assessment,
                }
            ]
        },
        // {
        //     path:'/',
        //     component:App,
        //     redirect:'/App',
        // },
        {
            path:'',
            name:'LoReg',
            component:LoReg,
        },
        {
            path:'/rulerLogin',
            component:RulerLogin,
        },
        {
            path:'/RulerMain',
            component:RulerMain,
            children:[
                {
                    path:'',
                    component:ImageDetection,
                },
                {
                    path:'VideoDetection',
                    component:VideoDetection,
                },
                {
                    path:'Assessment',
                    component:Assessment,
                },
                {
                    path:'ClassManage',
                    component:ClassManage,
                }
            ]
        }
    ]
});


//向外共享路由的实例对象
export default router;
